<template>
  <section>
    <!--start  面包屑-->
    <div class="location">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{path:'/index'}">首页</el-breadcrumb-item>
        <el-breadcrumb-item>商城</el-breadcrumb-item>
        <el-breadcrumb-item>模板管理</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <!--start content-->
    <div class="content" id="content">
      <el-tabs v-model="activeName">
         <!--<el-tab-pane label="PC端" name="first">
           <div class="template-box">
                <ul class="template-ul">
                  <li>
                      <div class="template-mask">
                          <el-button type="primary" style="margin-left: 0!important;">应用发布</el-button>
                          <a href="" target="_blank" class="preView">预览</a>
                      </div>
                      <img class="template-img" src="../../../img/center.jpg"/>
                      <p class="template-img-title">招商宣传模板</p>
                  </li>
                  <li>
                    <img class="template-img" src="../../../img/center.jpg"/>
                  </li>
                </ul>
            </div>
        </el-tab-pane>-->
        <el-tab-pane label="手机端" name="second">
          <div class="template-box">
            <ul class="template-ul">
              <li>
                <div class="template-mask">
                 <!-- <el-button type="primary" style="margin-left: 0!important;">应用发布</el-button>-->
                  <a class="preView" @click="showQrData"> 预览</a>
                </div>
                <img class="template-img" src="../../../img/phoneTemplate.png"/>
                <p class="template-img-title">默认商城模板</p>
              </li>
              <!--<li>
                <img class="template-img" src="../../../img/center.jpg"/>
              </li>-->
            </ul>
          </div>
           <div class="content" style=" text-align:left" v-if="qrcodeUrl">
								<qrcode :value="portalWebsiteData.websiteWebUrl" v-if="portalWebsiteData.websiteWebUrl" :options="{ size: 200 }"></qrcode>
								</div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </section>
</template>
<script>
	import qrcode from 'vue-qrcode';
  export default {
  	components: { qrcode },
    data() {
      return {
      	qrcodeUrl:false,
        activeName: 'second',
        
        portalWebsiteData:{
					websiteWebUrl:"",  //手机端网站二维码
				},
      }
    },
    methods: {
    	//进入页面获取PC端数据
    	 queryViewVo(){
      	this.axios({
	        method: "get",
	        url: "/v3/portal/websites/00000002",
	        data:{},
				}).then((res) => {
					this.portalWebsiteData = res.data;
				}).catch((err) => {
					this.Public.openError(this, err.response.data);
				});
			},
			showQrData(){
				this.qrcodeUrl = !this.qrcodeUrl;
			},
    },

    created(){
			this.queryViewVo();
    },
    mounted() {
      // 设置窗口高度 start
      var winHieg = document.documentElement.clientHeight;
      var cont = document.getElementById("content");
      cont.style.height = winHieg - 115 + "px";

    },
  }
</script>
<style scoped>

  .preView{
    padding: 7px 21px;
    background: white;
    margin-left: 10px;
    border-radius: 4px;
  }

  .preView:hover{
    opacity: 0.9;
  }

  .template-mask{
    display: none;
    position: absolute;
    top:0;
    left: 0;
    background:rgba(0,0,0,0.5);
    z-index: 22;
    width:211px;
    height: 71px;
    text-align: center;
    padding-top: 220px;
  }

  .template-img{
    height: 290px;
    width: 100%;
    border:1px #dddddd solid;
  }

  .template-img-title{
    height: 40px;
    line-height: 40px;
    text-align: center;
  }

  .template-ul li:hover .template-mask{
   display: block;
  }

  .template-ul li{
    position: relative;
    width: 210px;
    height: 330px;
    margin: 0 16px 16px 0;
    float: left;
  }

  .template-ul{
    width: 100%;
    overflow: hidden;
  }

  .template-box{
    padding-top: 30px;
  }

  .location {
    padding: 3px 0 15px 0;
  }

  .content {
    background: #fff;
    padding: 8px 15px 15px 15px;
    overflow-y: auto;
    font-family: "微软雅黑";
    position: relative;
  }
</style>
